package com.ruoyi.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

public class WechatConstants {

    /**
     * 体验版状态枚举
     */
    @AllArgsConstructor
    @Getter
    public enum ReviewStatusEnum {
        //待审核
        PRE_CHECK(0),
        //审核中
        AUDITING(1),
        //审核通过
        PASS(2),
        //审核不通过
        REJECT(3),
        //未提交
        NULL(-1),
        ;

        private int value;
    }

    /**
     * 体验版状态枚举
     */
    @AllArgsConstructor
    @Getter
    public enum CommitStatusEnum {
        //待检测
        PRE_CHECK(0),
        //待提交
        PRE_COMMIT(1),
        //审核中
        AUDITING(2),
        //审核通过
        PASS(3),
        //已发布
        RELEASE(4),
        //审核被拒绝
        REJECT(10),
        //审核被撤回
        ROLLBACK(11),
        //未提交
        NULL(-1),
        ;

        private int value;
    }

    /**
     * 审核状态枚举
     */
    @AllArgsConstructor
    @Getter
    public enum AuditStatusEnum {

        //审核通过
        PASS(0),
        //审核被拒绝
        REJECT(1),
        //审核中
        AUDITING(2),
        //已撤回
        ROLLBACK(3),
        //审核延后
        DELAY(4),
        NULL(-1),
        ;

        private int value;

        public static AuditStatusEnum match(int value) {
            for (AuditStatusEnum one : AuditStatusEnum.values()) {
                if (one.getValue() == value) {
                    return one;
                }
            }
            return AuditStatusEnum.NULL;
        }
    }
}
